using System;
using System.Text;
using System.Collections.Generic;

namespace Demo_G.O.S.E.ServerEngine.AIEngine.Agent
{

/**
 * This class encapsulates description data about a Daemon.  This will most
 * commonly be used by an agent to find out what DaemonServices are available
 * to an agent on both local and remote Daemons.
 */
    public class DaemonDescription
    {

        /** The IP address of the remote Daemon. */
        private String address;

        /** The hostname of the remote Daemon. */
        private String host;

        /** The port of the remote Daemon. */
        private long port;

        /** A list of known services for the remote Daemon. */
        //private String[] services;


        /**
         * Constructs a DaemonDescription with the given list of properties.
         *
         * @param address  The local host address for the Daemon.
         * @param host     The local host name for the Daemon.
         * @param port     The port the Daemon is listening on.
         * @param services The list of services the Daemon has.
         */
        public DaemonDescription( String address, String host, long port, String[] services )
        {
            this.address = address;
            this.host = host;
            this.port = port;
            //this.services = (String[])services.clone();
        }

        /**
         * Returns the IP address for the DaemonDescription.
         *
         * @return The IP address.
         */
        public String getHostIP()
        {
            return address;
        }

        /**
         * Returns the hostname for the DaemonDescription.
         *
         * @return The hostname.
         */
        public String getHostName()
        {
            return host;
        }

        /**
         * Returns the port for the DaemonDescription.
         *
         * @return The port.
         */
        public long getPort()
        {
            return port;
        }

        /**
         * Returns the list of services for the DaemonDescription as an array
         * of Strings.
         *
         * @return The list of services for the DaemonDescription.
         */
        //public String[] getServices() {
        //return (String[])services.clone();
        //}

        /**
         * Returns a String representation of this Object.
         *
         * @return A String representation of this Object.
         */
        public String toString()
        {
            return "Daemon-" + host + "/" + address + ":" + port;
        }
    }
}
